From: Timo Tijhof Date: Wed, 19 Mar 2014 21:34:14 +0000 (+0100) Subject: mediawiki.util: Fix jsduck syntax and minor clean up X-Git-Tag: 1.31.0-rc.0~16450^2 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=5c9145dde700b69fc4dc2226d870512a9d6a2c25;p=lhc%2Fweb%2Fwiklou.git mediawiki.util: Fix jsduck syntax and minor clean up * Fix indentation of @param comment to not trigger
 context.
* Clean up descriptions.
* Apply coding conventions
  - Function call one one line, or one line per argument.
    Avoid arbitrary splitting mid-line when purely for the sake
    of line length.
* Combine string concatenation in one expression instead of
  adding twice.

Change-Id: Id9f2a7cef1c8bf1c01584fbb293d0605fc91337e
---

diff --git a/resources/mediawiki/mediawiki.util.js b/resources/mediawiki/mediawiki.util.js
index 082f807810..ffafd33675 100644
--- a/resources/mediawiki/mediawiki.util.js
+++ b/resources/mediawiki/mediawiki.util.js
@@ -135,18 +135,21 @@
 		/**
 		 * Get the link to a page name (relative to `wgServer`),
 		 *
-		 * @param {string} str Page name to get the link for.
+		 * @param {string} str Page name
 		 * @param {Object} [params] A mapping of query parameter names to values,
-		 *     e.g. `{ action: 'edit' }`.
-		 * @return {string} Location for a page with name of `str` or boolean false on error.
+		 *  e.g. `{ action: 'edit' }`
+		 * @return {string} Url of the page with name of `str`
 		 */
 		getUrl: function ( str, params ) {
-			var url = mw.config.get( 'wgArticlePath' ).replace( '$1',
-				util.wikiUrlencode( typeof str === 'string' ? str : mw.config.get( 'wgPageName' ) ) );
+			var url = mw.config.get( 'wgArticlePath' ).replace(
+				'$1',
+				util.wikiUrlencode( typeof str === 'string' ? str : mw.config.get( 'wgPageName' ) )
+			);
+
 			if ( params && !$.isEmptyObject( params ) ) {
-				url += url.indexOf( '?' ) !== -1 ? '&' : '?';
-				url += $.param( params );
+				url += ( url.indexOf( '?' ) !== -1 ? '&' : '?' ) + $.param( params );
 			}
+
 			return url;
 		},